#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from io import BytesIO
f = BytesIO()
f.write(b'hello')
f.write(b' ')
f.write(b'world')
print(f.getvalue())

data = '今天天气不错，\n一般的爽\n'.encode('utf-8')
f = BytesIO(data)
print(f.read())
